package burubaka.meta;

//@javax.annotation.Generated(value = { "slim3-gen", "@VERSION@" }, date = "2012-05-04 21:41:09")
/** */
public final class HandicappingMeta extends org.slim3.datastore.ModelMeta<burubaka.model.Handicapping> {

    /** */
    public final org.slim3.datastore.UnindexedAttributeMeta<burubaka.model.Handicapping, com.google.appengine.api.datastore.Text> comment = new org.slim3.datastore.UnindexedAttributeMeta<burubaka.model.Handicapping, com.google.appengine.api.datastore.Text>(this, "comment", "comment", com.google.appengine.api.datastore.Text.class);

    /** */
    public final org.slim3.datastore.StringAttributeMeta<burubaka.model.Handicapping> horseName1 = new org.slim3.datastore.StringAttributeMeta<burubaka.model.Handicapping>(this, "horseName1", "horseName1");

    /** */
    public final org.slim3.datastore.StringAttributeMeta<burubaka.model.Handicapping> horseName2 = new org.slim3.datastore.StringAttributeMeta<burubaka.model.Handicapping>(this, "horseName2", "horseName2");

    /** */
    public final org.slim3.datastore.StringAttributeMeta<burubaka.model.Handicapping> horseName3 = new org.slim3.datastore.StringAttributeMeta<burubaka.model.Handicapping>(this, "horseName3", "horseName3");

    /** */
    public final org.slim3.datastore.StringAttributeMeta<burubaka.model.Handicapping> horseName4 = new org.slim3.datastore.StringAttributeMeta<burubaka.model.Handicapping>(this, "horseName4", "horseName4");

    /** */
    public final org.slim3.datastore.StringAttributeMeta<burubaka.model.Handicapping> horseName5 = new org.slim3.datastore.StringAttributeMeta<burubaka.model.Handicapping>(this, "horseName5", "horseName5");

    /** */
    public final org.slim3.datastore.StringAttributeMeta<burubaka.model.Handicapping> horseName6 = new org.slim3.datastore.StringAttributeMeta<burubaka.model.Handicapping>(this, "horseName6", "horseName6");

    /** */
    public final org.slim3.datastore.CoreAttributeMeta<burubaka.model.Handicapping, java.lang.Integer> horseNo1 = new org.slim3.datastore.CoreAttributeMeta<burubaka.model.Handicapping, java.lang.Integer>(this, "horseNo1", "horseNo1", int.class);

    /** */
    public final org.slim3.datastore.CoreAttributeMeta<burubaka.model.Handicapping, java.lang.Integer> horseNo2 = new org.slim3.datastore.CoreAttributeMeta<burubaka.model.Handicapping, java.lang.Integer>(this, "horseNo2", "horseNo2", int.class);

    /** */
    public final org.slim3.datastore.CoreAttributeMeta<burubaka.model.Handicapping, java.lang.Integer> horseNo3 = new org.slim3.datastore.CoreAttributeMeta<burubaka.model.Handicapping, java.lang.Integer>(this, "horseNo3", "horseNo3", int.class);

    /** */
    public final org.slim3.datastore.CoreAttributeMeta<burubaka.model.Handicapping, java.lang.Integer> horseNo4 = new org.slim3.datastore.CoreAttributeMeta<burubaka.model.Handicapping, java.lang.Integer>(this, "horseNo4", "horseNo4", int.class);

    /** */
    public final org.slim3.datastore.CoreAttributeMeta<burubaka.model.Handicapping, java.lang.Integer> horseNo5 = new org.slim3.datastore.CoreAttributeMeta<burubaka.model.Handicapping, java.lang.Integer>(this, "horseNo5", "horseNo5", int.class);

    /** */
    public final org.slim3.datastore.CoreAttributeMeta<burubaka.model.Handicapping, java.lang.Integer> horseNo6 = new org.slim3.datastore.CoreAttributeMeta<burubaka.model.Handicapping, java.lang.Integer>(this, "horseNo6", "horseNo6", int.class);

    /** */
    public final org.slim3.datastore.CoreAttributeMeta<burubaka.model.Handicapping, com.google.appengine.api.datastore.Key> key = new org.slim3.datastore.CoreAttributeMeta<burubaka.model.Handicapping, com.google.appengine.api.datastore.Key>(this, "__key__", "key", com.google.appengine.api.datastore.Key.class);

    /** */
    public final org.slim3.datastore.CoreAttributeMeta<burubaka.model.Handicapping, java.lang.Integer> payOffFlag = new org.slim3.datastore.CoreAttributeMeta<burubaka.model.Handicapping, java.lang.Integer>(this, "payOffFlag", "payOffFlag", int.class);

    /** */
    public final org.slim3.datastore.StringAttributeMeta<burubaka.model.Handicapping> raceDate = new org.slim3.datastore.StringAttributeMeta<burubaka.model.Handicapping>(this, "raceDate", "raceDate");

    /** */
    public final org.slim3.datastore.StringAttributeMeta<burubaka.model.Handicapping> raceName = new org.slim3.datastore.StringAttributeMeta<burubaka.model.Handicapping>(this, "raceName", "raceName");

    /** */
    public final org.slim3.datastore.CoreAttributeMeta<burubaka.model.Handicapping, java.util.Date> updTime = new org.slim3.datastore.CoreAttributeMeta<burubaka.model.Handicapping, java.util.Date>(this, "updTime", "updTime", java.util.Date.class);

    /** */
    public final org.slim3.datastore.CoreAttributeMeta<burubaka.model.Handicapping, java.lang.Long> version = new org.slim3.datastore.CoreAttributeMeta<burubaka.model.Handicapping, java.lang.Long>(this, "version", "version", java.lang.Long.class);

    /** */
    public final org.slim3.datastore.CoreAttributeMeta<burubaka.model.Handicapping, java.lang.Long> wager = new org.slim3.datastore.CoreAttributeMeta<burubaka.model.Handicapping, java.lang.Long>(this, "wager", "wager", long.class);

    /** */
    public final org.slim3.datastore.CoreAttributeMeta<burubaka.model.Handicapping, java.lang.Long> withdrawal = new org.slim3.datastore.CoreAttributeMeta<burubaka.model.Handicapping, java.lang.Long>(this, "withdrawal", "withdrawal", long.class);

    /** */
    public final org.slim3.datastore.CoreAttributeMeta<burubaka.model.Handicapping, java.lang.Double> withdrawalRate = new org.slim3.datastore.CoreAttributeMeta<burubaka.model.Handicapping, java.lang.Double>(this, "withdrawalRate", "withdrawalRate", double.class);

    private static final HandicappingMeta slim3_singleton = new HandicappingMeta();

    /**
     * @return the singleton
     */
    public static HandicappingMeta get() {
       return slim3_singleton;
    }

    /** */
    public HandicappingMeta() {
        super("Handicapping", burubaka.model.Handicapping.class);
    }

    @Override
    public burubaka.model.Handicapping entityToModel(com.google.appengine.api.datastore.Entity entity) {
        burubaka.model.Handicapping model = new burubaka.model.Handicapping();
        model.setComment((com.google.appengine.api.datastore.Text) entity.getProperty("comment"));
        model.setHorseName1((java.lang.String) entity.getProperty("horseName1"));
        model.setHorseName2((java.lang.String) entity.getProperty("horseName2"));
        model.setHorseName3((java.lang.String) entity.getProperty("horseName3"));
        model.setHorseName4((java.lang.String) entity.getProperty("horseName4"));
        model.setHorseName5((java.lang.String) entity.getProperty("horseName5"));
        model.setHorseName6((java.lang.String) entity.getProperty("horseName6"));
        model.setHorseNo1(longToPrimitiveInt((java.lang.Long) entity.getProperty("horseNo1")));
        model.setHorseNo2(longToPrimitiveInt((java.lang.Long) entity.getProperty("horseNo2")));
        model.setHorseNo3(longToPrimitiveInt((java.lang.Long) entity.getProperty("horseNo3")));
        model.setHorseNo4(longToPrimitiveInt((java.lang.Long) entity.getProperty("horseNo4")));
        model.setHorseNo5(longToPrimitiveInt((java.lang.Long) entity.getProperty("horseNo5")));
        model.setHorseNo6(longToPrimitiveInt((java.lang.Long) entity.getProperty("horseNo6")));
        model.setKey(entity.getKey());
        model.setPayOffFlag(longToPrimitiveInt((java.lang.Long) entity.getProperty("payOffFlag")));
        model.setRaceDate((java.lang.String) entity.getProperty("raceDate"));
        model.setRaceName((java.lang.String) entity.getProperty("raceName"));
        model.setUpdTime((java.util.Date) entity.getProperty("updTime"));
        model.setVersion((java.lang.Long) entity.getProperty("version"));
        model.setWager(longToPrimitiveLong((java.lang.Long) entity.getProperty("wager")));
        model.setWithdrawal(longToPrimitiveLong((java.lang.Long) entity.getProperty("withdrawal")));
        model.setWithdrawalRate(doubleToPrimitiveDouble((java.lang.Double) entity.getProperty("withdrawalRate")));
        return model;
    }

    @Override
    public com.google.appengine.api.datastore.Entity modelToEntity(java.lang.Object model) {
        burubaka.model.Handicapping m = (burubaka.model.Handicapping) model;
        com.google.appengine.api.datastore.Entity entity = null;
        if (m.getKey() != null) {
            entity = new com.google.appengine.api.datastore.Entity(m.getKey());
        } else {
            entity = new com.google.appengine.api.datastore.Entity(kind);
        }
        entity.setUnindexedProperty("comment", m.getComment());
        entity.setProperty("horseName1", m.getHorseName1());
        entity.setProperty("horseName2", m.getHorseName2());
        entity.setProperty("horseName3", m.getHorseName3());
        entity.setProperty("horseName4", m.getHorseName4());
        entity.setProperty("horseName5", m.getHorseName5());
        entity.setProperty("horseName6", m.getHorseName6());
        entity.setProperty("horseNo1", m.getHorseNo1());
        entity.setProperty("horseNo2", m.getHorseNo2());
        entity.setProperty("horseNo3", m.getHorseNo3());
        entity.setProperty("horseNo4", m.getHorseNo4());
        entity.setProperty("horseNo5", m.getHorseNo5());
        entity.setProperty("horseNo6", m.getHorseNo6());
        entity.setProperty("payOffFlag", m.getPayOffFlag());
        entity.setProperty("raceDate", m.getRaceDate());
        entity.setProperty("raceName", m.getRaceName());
        entity.setProperty("updTime", m.getUpdTime());
        entity.setProperty("version", m.getVersion());
        entity.setProperty("wager", m.getWager());
        entity.setProperty("withdrawal", m.getWithdrawal());
        entity.setProperty("withdrawalRate", m.getWithdrawalRate());
        entity.setProperty("slim3.schemaVersion", 1);
        return entity;
    }

    @Override
    protected com.google.appengine.api.datastore.Key getKey(Object model) {
        burubaka.model.Handicapping m = (burubaka.model.Handicapping) model;
        return m.getKey();
    }

    @Override
    protected void setKey(Object model, com.google.appengine.api.datastore.Key key) {
        validateKey(key);
        burubaka.model.Handicapping m = (burubaka.model.Handicapping) model;
        m.setKey(key);
    }

    @Override
    protected long getVersion(Object model) {
        burubaka.model.Handicapping m = (burubaka.model.Handicapping) model;
        return m.getVersion() != null ? m.getVersion().longValue() : 0L;
    }

    @Override
    protected void assignKeyToModelRefIfNecessary(com.google.appengine.api.datastore.AsyncDatastoreService ds, java.lang.Object model) {
    }

    @Override
    protected void incrementVersion(Object model) {
        burubaka.model.Handicapping m = (burubaka.model.Handicapping) model;
        long version = m.getVersion() != null ? m.getVersion().longValue() : 0L;
        m.setVersion(Long.valueOf(version + 1L));
    }

    @Override
    protected void prePut(Object model) {
    }

    @Override
    protected void postGet(Object model) {
    }

    @Override
    public String getSchemaVersionName() {
        return "slim3.schemaVersion";
    }

    @Override
    public String getClassHierarchyListName() {
        return "slim3.classHierarchyList";
    }

    @Override
    protected boolean isCipherProperty(String propertyName) {
        return false;
    }

    @Override
    protected void modelToJson(org.slim3.datastore.json.JsonWriter writer, java.lang.Object model, int maxDepth, int currentDepth) {
        burubaka.model.Handicapping m = (burubaka.model.Handicapping) model;
        writer.beginObject();
        org.slim3.datastore.json.Default encoder0 = new org.slim3.datastore.json.Default();
        if(m.getHorseName1() != null){
            writer.setNextPropertyName("horseName1");
            encoder0.encode(writer, m.getHorseName1());
        }
        if(m.getHorseName2() != null){
            writer.setNextPropertyName("horseName2");
            encoder0.encode(writer, m.getHorseName2());
        }
        if(m.getHorseName3() != null){
            writer.setNextPropertyName("horseName3");
            encoder0.encode(writer, m.getHorseName3());
        }
        if(m.getHorseName4() != null){
            writer.setNextPropertyName("horseName4");
            encoder0.encode(writer, m.getHorseName4());
        }
        if(m.getHorseName5() != null){
            writer.setNextPropertyName("horseName5");
            encoder0.encode(writer, m.getHorseName5());
        }
        if(m.getHorseName6() != null){
            writer.setNextPropertyName("horseName6");
            encoder0.encode(writer, m.getHorseName6());
        }
        writer.setNextPropertyName("horseNo1");
        encoder0.encode(writer, m.getHorseNo1());
        writer.setNextPropertyName("horseNo2");
        encoder0.encode(writer, m.getHorseNo2());
        writer.setNextPropertyName("horseNo3");
        encoder0.encode(writer, m.getHorseNo3());
        writer.setNextPropertyName("horseNo4");
        encoder0.encode(writer, m.getHorseNo4());
        writer.setNextPropertyName("horseNo5");
        encoder0.encode(writer, m.getHorseNo5());
        writer.setNextPropertyName("horseNo6");
        encoder0.encode(writer, m.getHorseNo6());
        writer.setNextPropertyName("payOffFlag");
        encoder0.encode(writer, m.getPayOffFlag());
        if(m.getRaceDate() != null){
            writer.setNextPropertyName("raceDate");
            encoder0.encode(writer, m.getRaceDate());
        }
        if(m.getRaceName() != null){
            writer.setNextPropertyName("raceName");
            encoder0.encode(writer, m.getRaceName());
        }
        if(m.getUpdTime() != null){
            writer.setNextPropertyName("updTime");
            encoder0.encode(writer, m.getUpdTime());
        }
        writer.setNextPropertyName("wager");
        encoder0.encode(writer, m.getWager());
        writer.setNextPropertyName("withdrawal");
        encoder0.encode(writer, m.getWithdrawal());
        writer.setNextPropertyName("withdrawalRate");
        encoder0.encode(writer, m.getWithdrawalRate());
        writer.endObject();
    }

    @Override
    protected burubaka.model.Handicapping jsonToModel(org.slim3.datastore.json.JsonRootReader rootReader, int maxDepth, int currentDepth) {
        burubaka.model.Handicapping m = new burubaka.model.Handicapping();
        org.slim3.datastore.json.JsonReader reader = null;
        org.slim3.datastore.json.Default decoder0 = new org.slim3.datastore.json.Default();
        reader = rootReader.newObjectReader("horseName1");
        m.setHorseName1(decoder0.decode(reader, m.getHorseName1()));
        reader = rootReader.newObjectReader("horseName2");
        m.setHorseName2(decoder0.decode(reader, m.getHorseName2()));
        reader = rootReader.newObjectReader("horseName3");
        m.setHorseName3(decoder0.decode(reader, m.getHorseName3()));
        reader = rootReader.newObjectReader("horseName4");
        m.setHorseName4(decoder0.decode(reader, m.getHorseName4()));
        reader = rootReader.newObjectReader("horseName5");
        m.setHorseName5(decoder0.decode(reader, m.getHorseName5()));
        reader = rootReader.newObjectReader("horseName6");
        m.setHorseName6(decoder0.decode(reader, m.getHorseName6()));
        reader = rootReader.newObjectReader("horseNo1");
        m.setHorseNo1(decoder0.decode(reader, m.getHorseNo1()));
        reader = rootReader.newObjectReader("horseNo2");
        m.setHorseNo2(decoder0.decode(reader, m.getHorseNo2()));
        reader = rootReader.newObjectReader("horseNo3");
        m.setHorseNo3(decoder0.decode(reader, m.getHorseNo3()));
        reader = rootReader.newObjectReader("horseNo4");
        m.setHorseNo4(decoder0.decode(reader, m.getHorseNo4()));
        reader = rootReader.newObjectReader("horseNo5");
        m.setHorseNo5(decoder0.decode(reader, m.getHorseNo5()));
        reader = rootReader.newObjectReader("horseNo6");
        m.setHorseNo6(decoder0.decode(reader, m.getHorseNo6()));
        reader = rootReader.newObjectReader("payOffFlag");
        m.setPayOffFlag(decoder0.decode(reader, m.getPayOffFlag()));
        reader = rootReader.newObjectReader("raceDate");
        m.setRaceDate(decoder0.decode(reader, m.getRaceDate()));
        reader = rootReader.newObjectReader("raceName");
        m.setRaceName(decoder0.decode(reader, m.getRaceName()));
        reader = rootReader.newObjectReader("updTime");
        m.setUpdTime(decoder0.decode(reader, m.getUpdTime()));
        reader = rootReader.newObjectReader("wager");
        m.setWager(decoder0.decode(reader, m.getWager()));
        reader = rootReader.newObjectReader("withdrawal");
        m.setWithdrawal(decoder0.decode(reader, m.getWithdrawal()));
        reader = rootReader.newObjectReader("withdrawalRate");
        m.setWithdrawalRate(decoder0.decode(reader, m.getWithdrawalRate()));
        return m;
    }
}